package com.sqstudio.llk.command
{
	import com.sqstudio.llk.model.GameModel;
	import com.sqstudio.llk.model.vo.ItemVO;
	import com.sqstudio.llk.view.ItemView;
	
	import flash.geom.Point;
	
	import org.robotlegs.mvcs.Command;
	/**
	 *启动命令 
	 * @author Nestor
	 * 
	 */	
	public class StartUpCommand extends Command
	{
		[Inject]
		public var model:GameModel;
		
		public function StartUpCommand()
		{
		}
		
		override public function execute():void
		{
			var i:int,j:int;
			var arr:Array= model.itemVOArr;
			for(i=0;i<arr.length;i++){
				for(j=0;j<arr[0].length;j++){
					var itemVo:ItemVO = arr[i][j] as ItemVO;
					var itemItem:ItemView = new ItemView(itemVo);
					itemItem.x = itemVo.p.x * SYS.ITEM_WIDTH;
					itemItem.y = itemVo.p.y *  SYS.ITEM_HEIGHT;
//					contextView.addChild(itemItem);
				}
			}
			PathLogic.dataArr = model.itemVOArr;
		}
		
	}
}